#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QObject>
#include <QVector>
// renew

class Generate : public QObject
{
    Q_OBJECT
public:
    explicit Generate(QObject *parent = nullptr);
    void working(int num);

signals:
    void sendVector(QVector<int> qv); // 该信号用于将数据发送给主线程
};

// 冒泡排序
class BubbleSort : public QObject
{
    Q_OBJECT
public:
    explicit BubbleSort(QObject *parent = nullptr);
    void working(QVector<int> qv); // 任务函数

signals:
    void finish(QVector<int> qv); // 该信号用于将数据发送给主线程
};

//快速排序
class QuickSort : public QObject
{
    Q_OBJECT
public:
    explicit QuickSort(QObject *parent = nullptr);
    void working(QVector<int> qv);

private:
    void quickSort(QVector<int> &qv, int begin, int end);

signals:
    void finish(QVector<int> qv); // 该信号用于将数据发送给主线程
};
#endif // MYTHREAD_H
